{% extends "opda/base.html" %}

{% block mid %}
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
            {% if current_user.user_type == 10 or current_user.super_user %}
            <button class="pull-right btn btn-default" data-toggle="modal" data-target="#add_active_dialog">添加记录</button>
            {% endif %}
                {% if app_active|length %}
                    <table class="table table-hover" style="background-color: aliceblue;">
                        <thead>
                            <tr>
                                <th class="col-lg-2">name</th>
                                <th class="col-lg-2">time</th>
                                <th class="col-lg-2">number</th>
                                {% if current_user.user_type == 10 or current_user.super_user %}
                                <th class="col-lg-2">operate</th>
                                {% endif %}
                            </tr>
                        </thead>
{#                    请点击选择要管理用户：<br/>#}
                        <tbody>
                        {% for a in app_active %}
                            <tr>
                                <td>{{ app_mso.name }}</td>
                                <td>{{ a.record_time.strftime('%Y-%m-%d') }}</td>
                                <td>{{ a.active_amount }}</td>
                                {% if current_user.user_type == 10 or current_user.super_user %}
                                <td>
                                    <a href="/appactivedel/{{ a.id }}">删除</a>
                                </td>
                                {% endif %}
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% else %}
                    没有激活记录
                {% endif %}
            </div>

        </div>
    </div>
    {% include 'opda/block/dialog.html' %}
{% endblock %}
